<?php
//-------------------------------------------------------------------------------------------------------
//    header("Cache-Control: no-cache, must-revalidate");
//    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    //---------------------------------------------------------------------------------------------------

    require_once('../config.inc.php');

    //require_once($config['xajax']['path'] . 'xajax.inc.php');
    //require_once($config['app_dir'] . '/classes/rates.server.php');
    //require_once($config['app_dir'] . '/classes/forecasts.server.php');
    //require_once($config['app_dir'] . '/classes/sparklines.server.php');
    //require_once($config['app_dir'] . '/classes/RemindPassword.server.php');

    //---------------------------------------------------------------------------------------------------
    error_reporting(E_ALL & ~E_NOTICE);
    //---------------------------------------------------------------------------------------------------
    //$xajax = new xajax();
    //$xajax->debugOn();
    //$xajax->registerFunction("showLastForecasts");
    //$xajax->registerFunction("showSparkLines");
    //$xajax->registerFunction("showLastRates");
    //$xajax->registerFunction("processRemindPasswordForm");
    //$xajax->processRequests();
    //---------------------------------------------------------------------------------------------------
    require_once($config['app_dir'] . '/classes/staff.class.php');
    require_once($config['app_dir'] . '/includes/template.class.php');
    //---------------------------------------------------------------------------------------------------
    $Staff = new objStaff($config['app_id']);
    //---------------------------------------------------------------------------------------------------
    // SignOut
    //---------------------------------------------------------------------------------------------------
    if ( array_key_exists('logoff', $_GET) && '1' == $_GET['logoff'] ) {
        $Staff->Logout();
        header('Location:'.$_SERVER["PHP_SELF"]);
    }
    //---------------------------------------------------------------------------------------------------
    require_once($config['app_dir'] . '/classes/admin.menu.class.php');
    //---------------------------------------------------------------------------------------------------
    $main_menu = false;
    $sub_menu = false;
    if( array_key_exists('p', $_REQUEST) && !empty($_REQUEST['p']) ) $main_menu = $_REQUEST['p'];
    if( array_key_exists('s', $_REQUEST) && !empty($_REQUEST['s']) ) $sub_menu = $_REQUEST['s'];

    $Menu = new objMenu($main_menu, $sub_menu);
    //---------------------------------------------------------------------------------------------------
    $Template = new objTemplate();
    //$Template->Assign('xajaxjavascript', $xajax->printJavascript(addslashes($config['xajax']['js'])));

    $Template->Assign_by_ref('Staff', $Staff);
    $Template->Assign('content', $Menu->getContent());

    $Template->Assign('title', $Menu->getTitle());
    $Template->Assign('keywords', $Menu->getKeywords());
    $Template->Assign('description', $Menu->getDescription());

    $Template->Assign('menu_top', $Menu->getMenuTop());
    $Template->Assign('header', $Menu->getHeader());

    $Template->Assign('is_left', $Menu->getIsLeft());
    $Template->Assign('menu_header', $Menu->getMenuLeftHeader());
    $Template->Assign('content_left', $Menu->getContentLeft());

    $Template->Assign('is_right',  $Menu->getIsRight());
    $Template->Assign('content_right', $Menu->getContentRight());
    //---------------------------------------------------------------------------------------------------

    $Template->Display('pageAdmin.tpl');
//-------------------------------------------------------------------------------------------------------
?>